Maytag washer runs intermittently

Hello, I have a Maytag washer that turns on/off throughout the wash cycle. The machine properly fills and starts to wash, but then turns on/off throughout the rest of the cycle. The timer dial or skirt dial always goes to the end of the cycle so it doesn’t appear to be problem with the actual timer. Also, usually if I slightly pull out on the on/off knob on the control dial, it will turn back on. However, the ability to do this is also getting worse. My first impulse is to buy a new timer, but I’m wondering if this might be a problem with a connection instead. Thanks.