The United Kingdom leaves the European Union at 2300 GMT on Friday, ending its 47-year membership of the world’s biggest trading bloc.