Magnetic fields in molecular clouds at high galactic latitudes