A search for a standard model Higgs boson produced in association with a top-quark pair and decaying to bottom quarks is presented. Events with hadronic jets and one or two oppositely charged leptons are selected from a data sample corresponding to an integrated luminosity of 19.5[Formula: see text] collected by the CMS experiment at the LHC in [Formula: see text] collisions at a centre-of-mass energy of 8[Formula: see text]. In order to separate the signal from the larger [Formula: see text] + jets background, this analysis uses a matrix element method that assigns a probability density value to each reconstructed event under signal or background hypotheses. The ratio between the two values is used in a maximum likelihood fit to extract the signal yield. The results are presented in terms of the measured signal strength modifier, [Formula: see text], relative to the standard model prediction for a Higgs boson mass of 125[Formula: see text]. The observed (expected) exclusion limit at a 95 % confidence level is [Formula: see text] (3.3), corresponding to a best fit value [Formula: see text].