The metallicity dependence of the Cepheid period-luminosity (PL) relation is of importance in establishing the extragalactic distance scale. The aim of this paper is to investigate the metallicity dependence of the PL relation in V and K, based on a sample of 128 Galactic, 36 Large Magellanic Cloud (LMC), and 6 Small Magellanic Cloud (SMC) Cepheids with individual Baade-Wesselink (BW) distances (some of the stars also have an Hubble Space Telescope (HST) based and Hipparcos parallax or are in clusters) and individually determined metallicities from high-resolution spectroscopy. Literature values of the V-band, K-band, and radial velocity data were collected for the sample of Cepheids. Based on a (V-K) surface-brightness relation and a projection factor, distances were derived from a BW analysis. The p-relation finally adopted is 1.50-0.24logP. The slope of this relation is based on the condition that the distance to the LMC does not depend on period or (V-K) colour and that the slope of the PL relation based on the BW distances agrees with that based on apparent magnitude. The zero point of the relation is tight to the Cepheids with HST and revised Hipparcos parallaxes as well as to Cepheids in clusters. The slope of the Galactic and LMC K-band relation formally agrees within the errors, and combining all Cepheids (including the SMC) results in a negligible metallicity dependence and a relation of MK
=(-2.50±0.08)+(-3.06 ±0.06)logP. A similar conclusion is found for the reddening-free Wesenheit relation (W(VK)=K-0.13(V-K)), with MWVK
=(-2.68±0.08)+(-3.12±0.06)logP. In the V-band the situation is more complex. The slope of the LMC and the Galactic PL relation differ at the 3σ level. Combining the sample nevertheless results in a metallicity term significant at the 2σ level: MV
=(-1.55±0.09)+(-2.33±0.07)logP+(+0.23±0.11)[Fe/H]. Taking only the Galactic Cepheids, the metallicity term is no longer significant, namely (+0.17±0.25). Compared to the recent works by Storm et al. (2011A&A...534A..94S
), there is both agreement and disagreement. A similar dependence of the p-factor on period is found, but the zero point found here implies a shorter distance scale. The distance modulus (DM) to the LMC and SMC found here are 18.29±0.02 and 18.73±0.06 (statistical error on the mean), respectively. Systematic differences in reddening could have an effect of order +0.05 in DM. The details of the comparison of BW-based distances and Cepheids with HST and revised Hipparcos parallaxes also play a role. The method used by Storm et al. would lead to larger DM of 18.37 and 18.81 for the LMC and SMC, respectively. The LMC DM is shorter than the currently accepted value, which is in the range 18.42 to 18.55, and it is speculated that the p-factor may depend on metallicity. This is not predicted by theoretical investigations, but these same investigations do not predict a steep dependence on period either, indicating that additional theoretical work is warranted.