Barcelona took the lead against Malaga in controversial circumstances as Lucas Digne's cross seemed to have gone out of play before Gerard Deulofeu scored.