Twisted harmonic maps and the self-duality equations