Photodynamics of azobenzene in a hindering environment