Dependence of electron spin g-factor on magnetic field in quantum wells