Graphs with given diameter maximizing the algebraic connectivity