The three-time Vuelta winner, riding in his last race before retirement, launched his attack early with 26.5km remaining in the 129.4km stage 15. Miguel Angel Lopez (Astana) joined him before going on alone for his second stage win of the race.
"I wanted to be brave and see what would happen behind me, but Sky has a very powerful group and it was complicated," Contador said.
"I knew it was a risk, but I preferred to take it. It was a long effort and I struggled to finish it, but I do not regret what I did. It is my way of racing."
Watch: Vuelta a España stage 15 highlights
Froome caught Contador with 3.4km to race. When Ilnur Zakarin (Katusha-Alpecin) attacked just before the final kilometre, Contador had little left and slipped behind by 40 seconds.
Froome continues to lead the race by 1-01 over Vincenzo Nibali (Bahrain-Merida). Contador slipped from eighth to ninth, at 3-59, behind Michael Woods (Cannondale-Drapac).
"It was difficult to keep up with the pace because we were going very fast ahead and in the middle part, it would have been quite comfortable in the main group behind," he added. "That made me pay for it in the end, but you have to race the way you want and I enjoy doing it that way."
Contador, 34, announced that the Vuelta a España would be his last race after he had a disappointing Tour de France in July. Every day, Spanish fans turn at the starts and finishes to wish him farewell and to encourage such attacks.
"I want to enjoy myself, just like I've been enjoying myself up to now," he continued. "Let's take it day by day."
Thank you for reading 10 articles this month* Join now for unlimited access
Enjoy your first month for just £1 / $1 / €1
*Read 5 free articles per month without a subscription
Join now for unlimited access
Try first month for just £1 / $1 / €1
Gregor Brown is an experienced cycling journalist, based in Florence, Italy. He has covered races all over the world for over a decade - following the Giro, Tour de France, and every major race since 2006. His love of cycling began with freestyle and BMX, before the 1998 Tour de France led him to a deep appreciation of the road racing season.
Bikes of the Atlas Mountain Race 2023: from comfort gravellers to speed weapons, here’s what caught our eye
Covering 1,300km / 800mi of Morocco’s gravel roads and mountain passes, the Atlas Mountain Race demands a tech-heavy approach for its 3+ days of bikepacking racing
By Stefan Abram • Published
British champion Cameron Mason hoping for rain at Cyclo-cross World Championships
British national champion says patience will be the key in what’s expected to be a fast race in Hoogerheide, the Netherlands
By Tom Thewlis • Published