Measurement of top quark-antiquark pair production in association with a W or Z boson in pp collisions at root s=8 TeV