I tried turning the key off with the bike moving and the speedo went right to zero and read the correct speed when the key was turned on, so total power loss is not it. The gauge was working at the time, however.
Before I left, I took the chrome cover off and checked the connection. I was able to press it in a little further and it felt like it may have snapped into place. The ride afterward showed no signs of problems, but it was a short ride and it is quite a bit cooler out this evening than it was over the weekend when I was having problems. I guess I'll have to go for a longer ride.