Measurements of the associated production of a Z boson and b jets in pp collisions at sqrt(s) = 8 TeV