Phase diagram of the quarter-filled extended Hubbard model on a two-leg ladder