Could be several reasons but try the easiest first. Disconnect your battery and leave it over night. Reconnect it the following day and see if your speedo will then work.
I had a speedo failure on my 1999 Toyota Corolla where the rev counter worked, the odometer worked but the speedo had stopped working. I wanted all electrical devices in the car to loose any charge they had, so that the ecu could reset itself. Disconnecting for an hour had no effect but doing it over night brought my speedo back to life.
Doneit
January 2008