Rafael Nadal secured his place in the semi-finals of the French Open after defeating Novak Djokovic following an epic battle in Paris.