The 29-year-old Spaniard, who won the Monte Carlo Masters last week, has now won his opening 10 matches of the European clay-court season.
Nishikori won this event in 2014 and 2015 but was left to rue a series of missed break-point opportunities.
Argentine Vilas won 49 clay-court titles in the 1970s and early 1980s.
Nadal has a chance to beat that mark in May as he is set to play in events in Madrid and Rome before he goes for a 10th French Open title at Roland Garros.
In Barcelona, he saved seven of eight break chances in the opening set and converted both of the opportunities he got as Nishikori lost a set for the first time in the tournament.
Nadal led 4-1 in the second set, but was pegged back to 4-4 before he went on to win the tournament for a ninth time and collect the 69th professional title of his career.
"I think I served well which was very important," said the world number five. "The fact I had a good percentage of first serves allowed me to play better.
"In the second set I let a lot of opportunities go, but I am very happy to have resisted mentally and happy to win."
Rafael Nadal has equalled Guillermo Vilas' record of 49 clay-court titles by beating Japan's Kei Nishikori 6-4 7-5 in the final of the Barcelona Open.