On the nature of the X-ray absorption in the Seyfert 2 galaxy NGC 4507