Before you attempt to replace the door gasket, I recommend that you try these steps to remove mold from the washer:
Liquid chlorine bleach will kill any mold and mildew that is in the washer and on the door gasket. I recommend that you mix a solution of 2 cups of warm water with 1 cup of liquid chlorine bleach. Put on some protective gloves and carefully use a cloth to wipe down the entire door gasket with this strong bleach solution. Let the solution stay on the gasket for a couple of minutes and then wipe down the gasket with warm water.
Pour any remaining bleach solution and run an empty cycle on the washer with hot water.
Run a second empty cycle with the same solution of bleach and water poured through the regular detergent dispenser of the washer.
This routine may be necessary on a monthly basis even if you replaced the door gasket.
If possible, leave the door slightly ajar between uses of the washer to help it air out and prevent mold and mildew.
If this does not solve your problem with the current gasket, I recommend that you have a service technician replace the door gasket. This is not that easy of a repair. If the gasket is not replaced properly, it can leak or tear. An improperly installed door gasket could make your mold problem worse. Here is a link for the Sears Service website in case you need it:
Sears Home Services