A numerical analysis of the origin of the atomic-scale contrast in Kelvin probe force microscopy is presented. Atomistic simulations of the tip-sample interaction force field have been combined with a noncontact atomic force microscope simulator including a Kelvin module. The implementation mimics recent experimental results on the (001) surface of a bulk alkali halide crystal for which simultaneous atomic-scale topographical and contact potential difference contrasts were reported. The local contact potential difference does reflect the periodicity of the ionic crystal, but not the magnitude of its Madelung surface potential. The imaging mechanism relies on the induced polarization of the ions at the tip-surface interface owing to the modulation of the applied bias voltage. Our findings are in excellent agreement with previous theoretical expectations and experimental observations.