Effects of electromagnetic field on shearfree spherical collapse