From elliptic multiple zeta values to modular graph functions: open and closed strings at one loop