Williams said the 21-year-old would take part in three tests this year - including the current one in Bahrain - and five Friday practice sessions at Grand Prix weekends as well as simulator work at the Grove factory.
"I'm really happy to be joining the Williams family," Nasr, a former British Formula Three champion, said.
"They have a great history in the sport and some of the greatest Brazilian drivers of all time have driven for the team, so it's an honour to join names such as (Nelson) Piquet, (Ayrton) Senna and Massa."
Williams also announced a partnership with Banco do Brasil, with the bank's logo to appear on the engine cover of the Mercedes-powered car as well as driver overalls and team apparel.
The team have already announced a multi-year deal with Brazilian oil company Petrobras.
Massa joined Williams from Ferrari at the end of last season.