Optimal persistent currents for interacting bosons on a ring with a gauge field