I use a workaround for this that works well but is a bit convoluted.
Filter either the contacts or the companies you want and then, when you export, select All Properties. Then export either ALL contacts or ALL companies (the opposite of the database you filtered first time) and again select All Properties when exporting
Now open the two spreadsheets and you will find that in the Companies sheet there is a unique ID for associates Contacts and vice versa. Use VLook function to link them together.
As I said, it’s not pretty but it does work.