Quasi-electrostatic fields in the near-earth space produced by lightning and generation of runaway electrons in ionosphere