Role of non-thermal electrons on the generation of X-ray and EUV lines in solar flares