After returning from injury, Rafael Nadal's remarkable run continued with a four-set victory over Novak Djokovic to win his second US Open title.