That's written in the subjunctive, "denoting a mood of verbs used when the content of the clause is being doubted, supposed, feared true, etc, rather than being asserted" (Collins).
You tend to see it with constructions such as "If he were my brother, nobody would mess with me," or, "If only I were president."
Yes, it's confusing. If I'm not mistaken the subjunctive is one of the biggest sticking points in the English language for many people.
Its usage is also starting (like the who/whom distinction) to fade away in the mainstream, mainly because its absence doesn't (to my knowledge) change the meaning of an otherwise well-constructed sentence.