EU leaders have agreed in principle to extend Brexit until 31 January 2020 – meaning the UK will not leave as planned on Thursday.