Rafael Nadal won his first European clay title of the season in unfortunate circumstances at the Mutua Madrid Open when Kei Nishikori retired through injury.