As above answers state, the _subscribers data view could work for this, however what about Contacts that are not on the All Subscriber's table, or as mentioned, are outside the six month scope of the data view.
When I have faced this issue (exporting All Contacts), I use the "Mobile Lists" feature in Contact Builder. I make a List with only this criteria: Contact Key is not null.
I then run the List and it filters every Contact into the list (the number of records in the list matches my All Contacts number). I can export that list, and often need to use the FTP option since my file will be larger than 25mb.
When you go to retrieve the file, if you have Contacts in All Contacts that are NOT a Subscriber, you will encounter this documented issue - Export of a Mobile Filtered List results in an empty file. The solution in this article works to get an eventual export of All Contacts, however the limitation is that you can really only get an export of the Key for each Contact record, not the rest of the Contact properties.