Volkswagen reaches deal with union to keep German plants open