It is a contraction of 書いた の ですか, where 書いた is past tense of 書く (no iru in there).
ーの です is a common ending form of a sentence to make it sound smoother.
It does not change the meaning any way - you may think of it as "It is that ...." in English.
And -の です is usually shortened to -ん です。(you see this form all over the place)
か at the end is the suffix to turn it into a question.
So, it becomes 書いたんですか, to mean "(Did you) write it?".