Rafa, by a little bit..Same amount of "slams" won, but Rafa has more big titles here. Other numbers (except for H2H which goes Rafa's way (but I don't value it that much) are close to even, with Roger holding one more YE#1. Think about it: Roger is 5 years older, so if he retired after 2013 (obviously, he didn't), they would have done so at the same age, if Rafa retired now. Without even saying "weak era" (as I find that demeaning to several players and to what Roger achieved), I think it would be safe to say that Rafa's career was just a little stronger against slightly higher competition.
Some comments below:
Both would have 17 slams with 7 finals. Nadal would have won his first and last slam 13 years apart, Federer 9 years apart
1)Slight edge to Rafa for longevity at the top, but not a huge disparity.
2) Federer 6 YEC, Nadal 0 YEC 6 more big titles to Fed, but (see just below)...
Nadal 1 OSG, Federer 0 OSG
3) Nadal 33 masters, Federer 21 masters ...Considering the Olympics as well, that's 34-27 Rafa (Big "non-Slam" titles - a sizable edge in this category
4) Nadal 80 titles, Federer 77 Close enough to be negligible
5) Federer 5 YE#1, Nadal 4 YE#1 Slight edge to Fed
6) Federer 302 weeks #1, Nadal 196 weeks #1 Edge to Fed here, of course, but doesn't offset the "Big Titles" edge, even with one more YE#1 - which I value more than Weeks at #1
7) H2H would be 22-10 in Nadal's favour Of course, an edge numerically for Rafa, but it's not that huge of a deal for me