You'll still get some ragged edges that way but that type of foam can be sanded to smooth out the rough patches. Some people have used sanding disks on an angle grinder to get it to the final shape.
If you don't have an electric carving knife, use an exacto knife and try to make the cut in one smooth motion, other wise the knife will snag near the tip and tear along your cut as you go.