The prime minister said that he would try to secure a revised Brexit deal at an EU summit on October 17-18 but he is also prepared to leave without one