How to get contact details for all members?

I need to produce a directory with all of the contact details for all of the members. I’ve successfully extracted the required information from the contacts collection but how can I limit it to the contacts that are site members?