Production of q anti-q pairs in proton-nucleus collisions at high energies