The 56-year-old Spaniard was appointed in March following Steve McClaren's sacking but failed to keep the Magpies in the top flight.
He had a break clause in his contract if Newcastle were relegated and was widely expected to leave the club.
"The love I could feel from the fans was a big influence for me," he said.
Former Liverpool, Chelsea, and Real Madrid boss Benitez will have control over "all football-related matters" at the club, Newcastle said.
Benitez's decision also hinged on the amount of funds he has to strengthen the squad following their demotion to the Championship.
"This is a huge club and I wanted to be part of the great future I can see for Newcastle United," added Benitez. "The main thing for me is that I have assurances that we will have a strong team - a winning team."
Benitez, who was sacked by Real in January and has also managed Valencia, Inter Milan and Napoli, took over with Newcastle one point adrift of safety.
Despite losing only three of his 10 matches in charge, the Magpies were relegated with one game of the season remaining.
Home supporters used their final match - a 5-1 thrashing of Tottenham - to try to convince Benitez to stay at St James' Park, singing and chanting his name throughout the home game.
Newcastle managing director Lee Charnley described Benitez as "phenomenal" and "world-class", saying he had "captured the hearts and minds" of fans and the club as a whole.
"I believe with Rafa as manager it gives us the best possible chance of returning to the Premier League at the first time of asking and delivering success for this football club beyond that," added Charnley.
"It is clear that Rafa has connected deeply with the club's supporters and we do not underestimate the role they have played in his decision to stay."
Former Newcastle striker Alan Shearer said he was "delighted", but a "little bit surprised", telling BBC Radio 5 live: "For Newcastle to attract of a manager of his calibre is a coup."
BBC Sport pundit Mark Lawrenson, a former Newcastle coach, said: "He's a control freak in the nicest possible way. I would imagine he's probably got millions to buy players plus what he generates in sales. He is ruthless.
"He managed at a lower level in Spain, that's where he learned the art of management. He'll get them organised defensively straight away, which you have to do in the Championship.
"Newcastle, Liverpool, Valencia - all teams with a massive base of support and very loyal to their managers if they think they are any good. I can really understand why he's staying."

Horne won her first national title in the team pursuit at the National Track Championships in Manchester last week.
The 26-year-old says she is leaving her road cycling team in order to turn her attention to the 2016 Rio Games.
"This is the right thing for me to do now and put my eggs into one basket and try and make the Games," Horne said.
Warwickshire-born Horne, who represented Wales at the 2014 Commonwealth Games, won the national team pursuit title with Joanna Rowsell Shand, Dame Sarah Storey and Katie Archibald.
Horne has spent four years working alongside Storey, who has announced her team Podium Ambition will turn professional for the start of the Women's World Tour in 2016.
But with just four competitions left to gain selection, Horne insists her main concern is being part of the team pursuit in Rio.
"For me moving forward, the main focus between now and Rio, will be team pursuit," Horne told BBC Radio Wales Sport.
"Everything is about going quicker over that 4km distance with the girls.
"The smartest thing to do is to focus solely on that and leave the road."
Rafael Benitez is staying as Newcastle United manager after signing a new three-year contract following their relegation from the Premier League.
[NEXT_CONCEPT]
Welsh cyclist Ciara Horne is giving up the chance to ride professionally on the Women's World Tour next year in a bid to win an Olympic title.