Anisotropic superconductivity in the two-dimensional Hubbard model