Massachusetts restaurants will be allowed to reopen for socially distant outdoor seating in the coming weeks, followed by limited indoor seating, state officials said.