EU reaches agreement on climate law