A spinorial energy functional: critical points and gradient flow