Generation of the second harmonic in Rydberg excitons in copper oxide