Israel's army says they have shot dead three Palestinians after an attack near a Jewish settlement in the occupied West Bank.