Manchester United have agreed a two-year deal with former Paris St-Germain (PSG) striker Edinson Cavani.