Absorption and luminescence spectra and energy levels of Nd3+ and Er3+ ions in LiNbO3 crystals