System and method for determining harmonic contributions from nonlinear loads in power systems