Dynamical quark recombination in ultrarelativistic heavy-ion collisions and the proton-to-pion ratio