A contrast source inversion method for reconstructing objects in an inhomogeneous background medium