Charge quantization and dissipation in arrays of small Josephson junctions