The ionosphere as the source of the atmospheric electric sunrise effect