Champion in 2010, home favourite Rodriguez had a four-second lead going into the last and shortest of seven stages, a rain-soaked 121-kilometre ride around Barcelona's Montjuic hill.
Contador, a two-time Tour de France winner, mounted a half-hearted attack around 2 kms out but Rodriguez, known as "purito" due to his fondness for cigars, easily reined him in and all the top riders finished bunched together.
They were around two minutes behind Dutch stage winner Lieuwe Westra of Astana Pro Team, while BMC Racing Team's American rider Tejay van Garderen was third overall, three seconds behind Contador.
"Anything could happen right up to the last metre," Rodriguez said.
"A crash or a puncture at the wrong moment could have been decisive," added the 34-year-old Catalan.
"The team were really good, though, they were with me all the way to the last minute."
Tour de France champion Chris Froome, who was returning to competition after a back injury and had said he was unlikely to push for victory on the final day, finished 17 seconds off the lead in sixth, matching his overnight position.
The Briton took a tumble around the 58-km mark but suffered only minor injuries, according to Sky's sports director Nicolas Portal.
"He's got a small cut to his knee and has lost a bit of skin on his thigh and arm but nothing that won't heal in a few days time or hamper his training," Portal said on Sky's website (www.teamsky.com).
"Froomey will definitely have benefited from this week and it's got him back into swing of things from a racing point of view," he added.
"Seventeen seconds is not a lot at all and if there had been a time trial here he might have even won."
Riders had to cope with diverse weather conditions across the region for the 94th edition of the race, including snow and high winds, and the rain was beating down in the Catalan capital for Sunday's final stage.
There was little chance to attack on the slippery descents, with most of the top riders opting for caution, and organisers shortened the finishing circuit by 600 metres to avoid the most dangerous sections of road.
Froome sat out this month's Tirreno-Adriatico, won in impressive fashion by Contador, because of lower back pain.
He eased to victory in last year's Tour de France and finished the three-week race over six minutes ahead of fourth-placed Contador, who is expected to mount more of a challenge in the 2014 edition.
The Tour's Grand Depart in the English city of Leeds is on July 5.
- Sports & Recreation
- Tour de France
- Astana Pro Team