Unveiling the nature of the γ-ray emitting active galactic nucleus PKS 0521-36