Murray, who has slipped to 16th in the rankings after ending last year as No. 1, wasn't scheduled to play at the Abu Dhabi tournament. However, he filled in for Novak Djokovic, after the 12th-ranked Serb withdrew from his semifinal against Bautista Agut earlier in the day with a recurrence of pain in his right elbow.
Murray, who has been struggling to find full fitness following a right hip problem, was initially only in Abu Dhabi to practice before next month's Australian Open.
He is also expecting to play in Brisbane, Australia next week.
The 30-year-old British player lost his first two service games and trailed 4-0 against the 20th-ranked Spaniard. In the seventh game, he held a service game lasting 12 minutes.
"Obviously I made a slow start and Roberto is one of the best players in the world," Murray said. "When you haven't competed for a while, it takes time to get up to that pace. I started to feel a bit better toward the end, but I need to keep improving for sure."
Murray, a three-time Grand Slam winner, did not move around the court at his usual pace and his first serves were way below his best. He did have one ace late in the fifth game, in which he also executed an athletic lunge at the net to win a point.
What appeared to trouble Murray the most was retrieving shots on the run with his backhand. He sent a few returns into the net, and did not even go for a couple of shots. Even though he moved gingerly, it was understandable as he returned to training only last week.
"It was nice to be able to play," a relieved-sounding Murray said. "I was just planning on stopping here for a couple of days on the way to Australia to get some practice in with the guys."
Aside from an exhibition match against Roger Federer back home in Scotland last month, Murray has not played since losing to Sam Querrey in the Wimbledon quarterfinals in July.
Also Friday, U.S. Open runner-up Kevin Anderson of South Africa reached the final after beating fifth-ranked Austrian Dominic Thiem 7-6 (6), 6-4.
Andrey Rublev of Russia secured fifth place in the six-player tournament by beating Pablo Carreno Busta of Spain 6-4, 6-2.
On Saturday, 23-time grand slam champion Serena Williams returns to court with an exhibition match against French Open champion Jelena Ostapenko.
The 36-year-old Williams, the Australian Open champion, gave birth to her first child in September.