Modric gave the visitors the lead after 25 minutes when he curled one into the top corner after displaying some neat footwork on the edge of the box.
Ronaldo almost doubled the lead towards the end of the half, but Willand did well to get down to save his fizzing low effort.
© Getty Images
Thomas Delaney had a goal disallowed for the home side on 43 minutes when he handled the ball in the build-up to him bundling home.
Madrid doubled their lead three minutes after the restart when Ronaldo converted at the back post after Pepe's header put it on a plate for his Portugal teammate.
Ronaldo almost added a third after 76 minutes but his curled effort could only find the post after he had worked space for the shot well with his back to goal.
Gareth Bale missed a good chance after 81 minutes when he headed wide from Marcelo's cross before Ronaldo had a penalty saved late on.