Measurement of the spectrum in the energy region around the Q-value of neutrinoless double-beta decay