Pulsar-timing arrays, astrometry, and gravitational waves