Zeeman tomography of magnetic white dwarfs - I. Reconstruction of the field geometry from synthetic spectra