A numerical study of Rayleigh-Taylor instability in magnetic fluids