A stochastic maximum principle for processes driven by fractional Brownian motion