Electron-electron and electron-phonon relaxation in metals excited by optical pulse