Andy Murray retains his Shanghai Masters title by beating David Ferrer 7-5 6-4 in the final, and in doing so moves up to third in the world rankings.