Interplay of structural distortions, dielectric effects and magnetic order in multiferroic GdMnO3