Electromagnetic wave scattering by a partially coated obstacle in a piecewise homogeneous medium