Exact solution of a modified El Farol's bar problem:Efficiency and the role of market impact