The right-back has struggled for regular football in the past couple of seasons and had been linked with a return to former club Schalke in the summer.
He will be out of contract next summer and there had appeared little chance of extending his stay at the Allianz Arena, but Guardiola has been impressed by his performances this season.
The 28-year-old has emerged as a key man this season and has now been given hope that he could have a long-term future at the club.
Guardiola told kicker-Sportmagazin: "Rafinha is a superb player. I am surprised about his performances.
"He has played great in these last matches as well as doing fine in training also."
Rafinha is determined to carry on performing well for the remainder of the season to earn a place in Luiz Felipe Scolari's squad at next summer's World Cup.
The player told Bild: "I am doing fine and I am still hoping to play more and regularly.
"Who knows, maybe I can be back in the Brazil fold for the 2014 World Cup.
"Dani Alves of Barcelona is the starter, but no-one knows who will be his back-up next summer. If I keep up with my form and play matches, there could be a chance I can make it."