Electrical field profile and doping in planar lead halide perovskite solar cells