An extremal eigenvalue problem for surfaces with boundary