Magnetic field distribution in the quiet sun