Djokovic has had a difficult 2018 as he attempts to climb back up the rankings after an injury-hit 12 months.
Last week, Djokovic reached the third round in Monte Carlo before being beaten by Dominic Thiem and, to get more competition ahead of the French Open, he accepted a wild card into the Barcelona Open.
The Serbian, who last played in Barcelona in 2006, is projected to meet Nadal in the quarter-finals.
But Nadal, who has won in Barcelona 10 times, reckons Djokovic is right to play after little on-court action this year.