Twisted localized solutions of the Dirac equation: Hopfionlike states of relativistic electrons