Optimal lossy quantum interferometry in phase space