Remove any spiders you observe by trapping and releasing the spiders outside or by vacuuming the spiders. Regardless of the method you prefer to use, be sure to also vacuum up any spiderwebs and egg sacks you observe in the attic.
Apply a residual pesticide in the attic to eliminate any spiders in hiding. Many pesticide options are available for indoor spider control; contact insecticides can be sprayed on spiders you observe but will have little to not effect on spiders in hiding that avoid contacting the pesticide. Among residual pesticides for spiders, sorptive dusts containing amorphous silica gel (silica aerogel) and pyrethrins are typically the most effective, though these compounds may only legally be applied by professional exterminators, depending on pesticide regulations in your area.
Clean the attic to avoid future spider infestation. Chemical treatments are only effective insofar as they are combined with other non-chemical control methods such as sanitation and exclusion. Place boxes off the ground and away from walls and seal them with tape. Eliminate clutter in the attic and regularly clean up any secluded, dark area that could serve as harborage for future spider populations in the attic.