Analysis of the variations in the light curve of U Pegasi and starspot activity