If I accept a PhD offer but change my mind about attending, do I have an obligation to attend for some number of years before dropping out?
The April 15 resolution is a commitment that you won't accept another PhD offer without the OK of the school whose offer you accepted: 


  However, an acceptance given or left in force after April 15 commits the student not to accept another offer without first obtaining a written release from the institution to which a commitment has been made. 


and also a commitment not to accept an offer you don't expect to honor:


  Acceptance of an offer of financial support* (such as a graduate scholarship, fellowship, traineeship, or assistantship) for the
  next academic year by a prospective or enrolled graduate student completes an agreement that both student and graduate
  school expect to honor. 


It doesn't obligate you to go to grad school if you decided you don't want to, after all. 

If you are really sure you don't want to do a PhD, the department will be much happier if you don't start (rather than starting and dropping out), so that they can offer your spot to someone else. In the first part of a PhD, the department is investing (time, money, teaching and supervision) in you with an expectation of future returns. You're not doing them any favors by letting them invest those resources in you when you don't plan to really use them.

You can politely inform the person responsible for the program (e.g. director of graduate studies) that you don't plan to attend after all.