An extension of the Hertz theory for three-dimensional coated bodies