International audienceContext: The ionization fraction (i.e., the electron abundance) plays a key role in the chemistry and dynamics of molecular clouds. Aims: We study the H13CO^+, DCO+ and HOC+ line emission towards the Horsehead, from the shielded core to the UV irradiated cloud edge, i.e., the photodissociation region (PDR), as a template to investigate the ionization fraction gradient in molecular clouds. Methods: We analyze an IRAM Plateau de Bure Interferometer map of the H13CO+ J=1-0 line at a 6.8''× 4.7'' resolution, complemented with IRAM-30 m H13CO+ and DCO+ higher-J line maps and new HOC+ and CO+ observations. We compare self-consistently the observed spatial distribution and line intensities with detailed depth-dependent predic...