President Donald Trump is pulling the US out of the world's first comprehensive deal on climate change, he has announced.