One of the distinctive features of hole-doped cuprate superconductors is the onset of a `pseudogap below a temperature $T^*$. Recent experiments suggest that there may be a connection between the existence of the pseudogap and the topology of the Fermi surface. Here, we address this issue by studying the two-dimensional Hubbard model with two distinct numerical methods. We find that the pseudogap only exists when the Fermi surface is hole-like and that, for a broad range of parameters, its opening is concomitant with a Fermi surface topology change from electron- to hole-like. We identify a common link between these observations: the pole-like feature of the electronic self-energy associated with the formation of the pseudogap is found to also control the degree of particle-hole asymmetry, and hence the Fermi surface topology transition. We interpret our results in the framework of an SU(2) gauge theory of fluctuating antiferromagnetism. We show that a mean-field treatment of this theory in a metallic state with U(1) topological order provides an explanation of this pole-like feature, and a good description of our numerical results. We discuss the relevance of our results to experiments on cuprates.