Competition between photodissociation and photoionization in methyl iodide