Teachers, city reach accord in contract dispute