Spectral invariants for hyperbolic polygons