Optically induced static magnetic field in the ensemble of nitrogen-vacancy centers in diamond.