Nadal, ranked No. 2, will take on unseeded Santiago Giraldo of Colombia in the final eight. Giraldo beat Dmitry Tursunov of Russia 6-4, 7-6 (4) earlier.
In other matches, third-seeded David Ferrer of Spain advanced with a 4-6, 6-2, 6-2 victory over Australian qualifier Matthew Ebden Ferrer will next face Radek Stepanek after the Czech beat Marco Chiudinelli of Switzerland 7-5, 6-7 (5), 6-1.
Second-seeded Andy Roddick plays America's Alex Bogomolov Jr. in a late match.
Trailing 6-5 and serving at 30-30 in the 12th game of the first set, Raonic double faulted to hand the Nadal set point. The Canadian then hit a forehand long to give the Spaniard the set.
In the second set, Nadal broke the big-serving Raonic in the sixth game to go up 4-2, then stayed on serve and closed out the contest in 1 hour, 30 minutes.
Nadal, the defending champion, got in 77 percent of his first serves in the victory and Raonic was not able to gain a single break point against the 10-time Grand Slam champion in the match.
Raonic's powerful forehand was impressive, but he also committed several unforced errors in the defeat.