Rafael Nadal came back from one set down to beat Andy Murray and secure a spot in the Italian Open semifinals.