Euclid preparation. XVIII. The NISP photometric system