I.B.M. announced on Tuesday that it had agreed to buy SoftLayer Technologies, a cloud computing company, as more technology firms pursue the sector.