Merkel welcomes EU agreement to control migration