If you have Force deformation curve it's not a problem. You can calculate it by using E = summation of (F *(d2 - d1)) i.e. integrate the force deformation curve
The strain energy will be recovered during unloading and you will only get the dissipated energy.
Rajib why don't you go through Dynamics of Structure Chapter 7. You can find the equation there. Please note that it is for dynamic case so don't get confused seeing K.E. term and Strain energy term at any time instant.