Superfluid and dissipative dynamics of a Bose-Einstein condensate in a periodic optical potential