  Context. Searching for extrasolar planets through radial velocity
measurements relies on the stability of stellar photospheres. Aims. We aim at
characterizing the statistical properties of magnetic activity cycles, and
studying their impact on spectroscopic measurements such as radial velocities,
line bisectors and line shapes. Methods. We use data from the HARPS
high-precision planet-search sample comprising 304 FGK stars followed over
about 7 years. We obtain high-precision Ca II H&K chromospheric activity
measurements and convert them to R'HK indices using an updated calibration
taking into account stellar metallicity. We study R'HK variability as a
function of time and search for possible correlations with radial velocities
and line shape parameters. Results. We classify stars according to the
magnitude and timescale of the Ca II H&K variability, and identify activity
cycles whenever possible. We find that 39+/-8% of old solar-type stars in the
solar neighborhood do not show any activity cycles (or only very weak ones),
while 61+/-8% do have one. Non-cycling stars are almost only found among G
dwarfs and at mean activity levels log R'HK < -4.95. Magnetic cycle amplitude
generally decreases with decreasing activity level. A significant fraction of
stars exhibit small variations in radial velocities and line shape parameters
that are correlated with activity cycles. The sensitivity of radial velocities
to magnetic cycles increases towards hotter stars, while late K dwarfs are
almost insensitive. Conclusions. Activity cycles do induce long-period,
low-amplitude radial velocity variations, at levels up to ~25 m/s. Caution is
therefore mandatory when searching for long-period exoplanets. However, these
effects can be corrected to high precision by detrending the radial velocity
data using simultaneous measurements of Ca II H&K flux and line shape
parameters. (Abridged)
