Volkswagen and the IG Metall union have agreed a 4.2% pay rise that will affect 95,000 staff in six western German plants.