The first international agreement to protect the world’s oceans for 40 years has been reached.