Just to show how bad it was, here are scores that other mma websites gave for the fight. (I got all of this info from a thread on sherdog)
For Rua:
FightMetric: 49-47 Rua
Yahoo Sports / Cagewriter: 48-47 Rua
BloodyElbow : 48-47 Rua
USAToday: 48-47 Rua, 49-46 Rua
Savage Science: 49-46 Rua
ESPN / Jake Rossen: 49-46 or 48-47 Rua
MMA Fanhouse / Michael David Smith: 48-47 Rua
411mania.com: 48-47 Rua
CagePotato: 49-46 Rua
MMATorch : 48-47 Rua
MMAJunkie : 49-46 or 48-47 Rua
MMAMania : 50-45 Rua
5 Ounces of Pain : Rua (no score given)
Fightlinker : Rua (no score given)
MMAConvert: Rua ("Machida was given a gift")
ProMMA.Info: 50-45 Rua
Sherdog:
Jordan Breen -- 48-47 Rua
Brian Knapp -- 48-47 Rua
Mike Fridley -- 50-45 Rua
Sports Illustrated (thanks jamers):
Ben Fowlkes - Rua ("They say you have to clearly beat the champion if you want to take his belt. Mauricio "Shogun" Rua seemed to have done just that at UFC 104 on Saturday night, but the mere fact that UFC light heavyweight champ Lyoto Machida was still conscious at the end was apparently enough for the judges to give him the victory")
Joss Gross: 48-47 Rua
Also, right after the fight, espn.com had a headline that said rua decisions machida for the title, so they obviously thought that Rua won too.
For Machida:
5th Round: 48-47 Machida*