Cross-correlation of the astrophysical gravitational-wave background with galaxy clustering