Michael Quinion, who writes citations for the OED, has covered this one on his web site:

We don't know for sure where [quiz] comes from, but it doesn't seem to be as old as Shakespeare's day. It was first recorded in the late 1700s, in the sense of an odd or eccentric person. Later it became another word for a joke or a witticism and only about the middle of the nineteenth century did it take on the modern meaning of a more-or-less formal set of questions. There is a famous tale about a Dublin theatre manager named James Daly, who accepted a bet that he could create a new word without any meaning and have everybody in the city using it within 24 hours. He is said to have employed a large number of urchins to go around the city and chalk the word quiz on every surface they could find so that the next day everybody was asking what this word meant. The story is best viewed through the bottom of a glass of something Irish.