Uniqueness of the metric from the Weyl and energy-momentum tensors