Relays and PWM don't normally work together... they do make nice sounds before breaking though.
Optocouplers can be a problem depending on the frequency you choose to control your motor. Normally PWM frequencies for motors tend to be somewhat high, whilst commuting frequencies for optos (the cheaper kind) aren't. Not that it is impossible, it is more expensive and maybe difficult to locate the parts.
So, you could control the motor with a power driver L298, 293, something like that, or go with transistors. Both of which have plenty of schematics around the internet.