Stable determination of the electromagnetic coefficients by boundary measurements