If leaders cannot come to an agreement it could mean an EU emergency summit days before the UK is due to leave.