The 20-time Grand Slam champion will play doubles with the Spaniard, who has won 22 majors, at the O2 arena in London on Friday.
Federer and Nadal, representing Team Europe, will face US players Frances Tiafoe and Jack Sock of Team World in the evening session.
Federer, whose most recent competitive match was a loss to Hubert Hurkacz in last year's Wimbledon quarter-finals, has been struggling with a knee problem and will not play singles in London.
"I'm not sure if I can handle it all but I'll try," said Federer, 41.
"This one feels a whole lot different. I'm happy to have him on my team and not playing against him.
"Playing with Rafa feels really different. To be able to do it one more time, I'm sure it will be wonderful and I'll try my very best.
"I'll enjoy it but it will be very hard."
Nadal said he was looking forward to an "unforgettable" match alongside his Swiss rival.
"One of the most important, if not the most important players in my tennis career is leaving," the Spaniard said.
"At the end, this moment will be difficult. I'm super-excited and grateful to play with him."
The six-strong European team, captained by Bjorn Borg, also includes 21-time major winner Novak Djokovic and three-time major winner Andy Murray.
Their opponents, Team World, skippered by John McEnroe, also include Taylor Fritz, Felix Auger-Aliassime and Diego Schwartzman.
Federer announced last week he intended to retire after the three-day Laver Cup.
Murray, making his debut at the Ryder Cup-style event, will take on Australia's Alex de Minaur earlier in the night session in London on Friday.
In the day session Norway's Casper Ruud faces Sock and Greek star Stefanos Tsitsipas meets Argentina's Schwartzman.
Italian Matteo Berrettini, the first alternate for Europe, will take Federer's place over the weekend.