If you voluntary contribute to a Distributed Denial of Service attack you are being an accessory if someone uses the botnet (you are voluntary part of) to perform an illegal action such as taking down a website. If this take down results in financial damages you may be hold accountable for those damages.
Here's a small excerpt of an interesting article on LOIC:
Getting back to DDoS arrests, there are many, many precedents of the
law catching up with anons who turn out to be not so anonymous. In
late 2010, a 16 year old Dutch teenager was arrested for using LOIC as
part of Operation Payback against companies that had begun refusing to
process payments to WikiLeaks. This lead to retaliation against the
national prosecutor’s website which quickly results in the arrest of
another Dutch teenager, this time a 19 year old. Apparently the guy
just fired LOIC up from his own PC connected directly to the internet
without taking any identity obfuscation measures. As the article in
the link says “That's a pretty silly mistake to make if you're going
to attack the website of your country's national prosecutor”. Indeed.
Then there was Giordani Jordan in the US a couple of years back,
Dmitry Olegovich Zubakha in Cyrpress and a two unnamed teenagers in
Norway last year plus of course Christopher Weatherhead in the UK who
we now know is in jail. It’s a rapidly growing list of global arrests.
Also installing a program which makes you part of a botnet is a bit retarded. You are voluntary building a potential backdoor into your system which will likely be used for malicious intent.
Note that all of the above is when you intentionally install custom versions of LOIC or additional programs which allow remote users to use your machine.
That said, if want to test a company's network (on their request with complete legal paperwork which state that they are aware what a DDoS actually does and that they are aware that this can take down their systems) then it should be OK to proceed. LOIC can be used to do this, or you can use Apache Benchmark as an alternative if you want to test a website. There is nothing wrong in using the tool, it is what you are using the tool for. It's similar to using a knife to kill someone or make turkey sandwiches.
Intent is key here. If you visited the website with the intent to view information, then this might be regarded as normal usage. If your intent is to take down a website in an orchestrated attack then yes it is illegal.