Drastically cutting back on sugar, or carbohydrates in general, will often produce a withdrawal headache. This will pass once your body adjusts to your new diet. You could try putting more good carbs in your diet (beans, dairy, vegetables) and that may ease the headache.
Withdrawing from caffeine can also give you a headache, if you've done that. This will also pass.
And/or, dehydration can contribute to headache--in which case, you should drink more plain old water, if you're not getting enough.