President Donald Trump has signed an executive order pulling the US out of the Paris Agreement just hours after taking office.