Given a nonlinear matrix-valued function F(λ) and approximate eigenpairs (λ_i, v_i), we discuss how to determine the smallest perturbation δ F such that [F + δ F](λ_i) v_i = 0; we call the distance between the F and F + δ F the backward error for this set of approximate eigenpairs. We focus on the case where F(λ) is given as a linear combination of scalar functions multiplying matrix coefficients F_i, and the perturbation is done on the matrix coefficients. We provide inexpensive upper bounds, and a way to accurately compute the backward error by means of direct computations or through Riemannian optimization. We also discuss how the backward error can be determined when the F_i have particular structures (such as symmetry, sparsity, or low-rank), and the perturbations are required to preserve them. For special cases (such as for symmetric coefficients), explicit and inexpensive formulas to compute the δ F_i are also given.