Determination of time-dependent coefficients for a hyperbolic inverse problem