The US president welcomed the UK referendum vote to leave the European Union last year.